﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pdfer.FileObjects
{
    /// <summary>
    /// XRef
    /// </summary>
    internal class XRefTable
    {
        public XRefTable(Int32 startId, Int32 count)
        {
            StartId = startId;
            ObjCount = count;
            ObjOffsetInfos = new List<ObjOffsetInfo>(count);
        }
        public Int32 StartId { get; private set; }
        public Int32 ObjCount { get; private set; }
        public List<ObjOffsetInfo> ObjOffsetInfos { get; private set; }
    }

    internal struct ObjOffsetInfo
    {
        /// <summary>
        /// 索引
        /// </summary>
        public Int32 Index;
        /// <summary>
        /// ObjStmId
        /// </summary>
        public Int32 ObjStmId = -1;
        /// <summary>
        /// 偏移量
        /// </summary>
        public Int32 Offset;
        /// <summary>
        /// 版本
        /// </summary>
        public Int32 Version;
        /// <summary>
        /// f 不使用 n 使用的
        /// </summary>
        public Char RefFlag;

        public Int32 RefId;

        public ObjOffsetInfo()
        {
        }
    }

}
